#include "WXTAuthenticationCmd.h"

WXTAuthenticationCmd::WXTAuthenticationCmd(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::WXTProtocol;
   this->m_functionCode = FunctionCode;
}

Package WXTAuthenticationCmd::toPackage()
{
    Package package;

 //   QString str("{\"redirect\":\"%2F404\"}");
   /*  MacXml *macXml = MacXml::getInstance();

     QString userName = macXml->userName();

      QString body("cmd=getToken&userName=");//admin&token=");
         body+=userName;
         body+="&passWord=";


   // QString body("cmd=getToken&userName=user1&passWord=");
    body+=m_password;
    package.setBody(body.toLatin1());
    QString head("/CAPool/SysOpenAPILogin.aspx");
    package.setHead(head.toLatin1()); */

    QString head("/gateway-tcp/se/");
    package.setHead(head.toLatin1());
    package.setBody(m_body);
    package.setSeData(m_sedata);

    package.setHttpHead(m_httpHead);
    return package;
}

void WXTAuthenticationCmd::unPackage(Package package)
{
   //m_token = package.body();
}

void WXTAuthenticationCmd::setBody(QByteArray body){
  m_body = body;
}

void WXTAuthenticationCmd::setSeData(struct SeData sedata)
{
    m_sedata = sedata;
}

void WXTAuthenticationCmd::setHttpHead(QMap<QByteArray,QByteArray> httpHead)
{
    m_httpHead=httpHead;
}



